#include<bits/stdc++.h>

using namespace std;

int main() {
    char s[10];
    int x, y, z;
    for (x = 123; 3 * x <= 987; x++) {
        y = 2 * x;
        z = 3 * x;
        sprintf(s, "%d%d%d", x, y, z);
        sort(s, s + 9);
        if (strcmp(s, "123456789") == 0) {
            cout << x << " " << y << " " << z << endl;
        }
        //比值是1:2:3
    }


    return 0;
}